<tagLib name="html" />
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>修改购物卡</title>
	<include file="Public:header" />
	<style type="text/css">
		.input{width:190px; border:1px solid #ccc; padding:2px;}
		.select{width:190px; border:1px solid #ccc; height:25px; padding:2px;}
	</style>
	<script type="text/javascript">
		function chkfrm()
		{
			if($('#card_c').val()=='')
			{
				$.messager.show({title:'提示',msg:'请输入购物卡号码',timeout:5000,showType:'slide'});
				return false;
			}
			return true;
		}
		
		function calc_amount()
		{
			var act_amount = $('#act_amount').val();
			if(act_amount=='')
			{
				$('#open_amount').attr('value',$('#old_amount').val());
				return false;
			}
			else if(isNaN(act_amount))
			{
				$.messager.show({title:'提示',msg:'金额输入错误',timeout:5000,showType:'slide'});
				$('#act_amount').attr('value','');
				$('#open_amount').attr('value',$('#old_amount').val());
				return false;
			}
			else
			{
				var old_amount = $('#old_amount').val();
				var new_amount = parseFloat(act_amount) + parseFloat(old_amount);
				$('#open_amount').attr('value',new_amount);
			}
		}
	</script>
</head>
<body class="">
	<div class="demo-info space-out-10px">
		<div class="demo-tip icon-tip"></div>
		<div>修改购物卡</div>
	</div>
	<form id="form1" method="post" action="{:U('Shopcard/data_edit_save')}" onsubmit="return chkfrm()">
	
	<ul class="idTabs space-out-10px"> 
		<li><a href="#tabs_basic">基本信息</a></li>
	</ul>
	<div id="tabs_basic">
		<table class="space-out-10px">
		<tr>
		<td style="width:100px;">购物卡号码：</td><td><input type="text" id="card_c" name="card_c" class="easyui-validatebox input" value="{$mydata.card_c}" readonly required="true" /></td>
		</tr>
				
		<tr>
		<td>备注：</td><td><input type="text" id="remark" name="remark" class="input" value="{$mydata.remark}" /></td>
		</tr>
		
		<tr>
		<td>状态：</td><td><input type="radio" name="status_flg" value="Y"<if condition="$mydata['status_flg'] eq 'Y'"> checked</if> />正常  <input type="radio" name="status_flg" value="N"<if condition="$mydata['status_flg'] eq 'N'"> checked</if> />禁用</td>
		</tr>
		
		<tr>
		<td>&nbsp;</td><td>--------------------------------------------------------------------------------------------</td>
		</tr>
		
		<tr>
		<td>现有金额：</td><td><input type="text" id="old_amount" name="old_amount" class="input" value="{$mydata.open_amount}" readonly /></td>
		</tr>
		
		<tr>
		<td>调整金额：</td><td><input type="text" id="act_amount" name="act_amount" class="input" value="" onchange="calc_amount()" />增加金额填正数，减少金额填负数</td>
		</tr>
		
		<tr>
		<td>调整金额说明：</td><td><input type="text" id="act_remark" name="act_remark" class="input" value="" /></td>
		</tr>
		
		<tr>
		<td>余额：</td><td><input type="text" id="open_amount" name="open_amount" class="input" value="{$mydata.open_amount}" readonly /></td>
		</tr>
		
		</table>	

		
	</div>
	
	
		<table class="space-out-10px">
		<tr>
		<td>&nbsp;</td><td>&nbsp;</td>
		</tr>
		<tr>
		<td>&nbsp;</td><td>
		<input type="hidden" id="id" name="id" value="{$mydata.id}" />
		<a href="javascript:;" class="easyui-linkbutton" iconCls="icon-save" onclick="$('#form1').submit();">保存</a>
		<a href="{:U('Shopcard/data_list')}" class="easyui-linkbutton" iconCls="icon-undo">取消</a>
		</td>
		</tr>
		</table>
		

	</form>

</body>
</html>
